import request from "@/utils/request";

export function addTestPaper(data) {
  return request({
    url: `/core/exam-paper/create`,
    method: "post",
    data,
  });
}
// 获取待考试的试卷列表
export function getStuAnswerList(params) {
  return request({
    url: `/core/stuAnswer/list`,
    method: "get",
    params,
  });
}
// 获取已完成的考试列表
export function getStuAnswerFinish(params) {
  return request({
    url: `/core/stuAnswer/finish`,
    method: "get",
    params,
  });
}
// 学生提交试卷
export function stuAnswerSubmit(data) {
  return request({
    url: `/core/stuAnswer/add`,
    method: "post",
    data,
  });
}
export function stuAnswerDetail(params) {
  return request({
    url: `/core/stuAnswer/details`,
    method: "get",
    params,
  });
}

// 老师批改试卷
export function teacherSubmit(data) {
  return request({
    url: `/core/stuAnswer/update`,
    method: "post",
    data,
  });
}

// 获取试卷详情
export function getTestPaperDetail(ids) {
  return request({
    url: `/core/exam-paper/details/${ids}`,
    method: "get",
  });
}
// 删除试卷
export function deleteTestPaperByIds(ids) {
  return request({
    url: `/core/exam-paper/delete/${ids}`,
    method: "delete",
  });
}
// 修改试卷
export function editTestPaper(data) {
  return request({
    url: `/core/exam-paper/update`,
    method: "put",
    data,
  });
}
// 自动组卷
export function autoTestPaper(data) {
  return request({
    url: `/core/exam-paper/auto/combine`,
    method: "post",
    data,
  });
}
// 考试分析老师列表
export function getTeacherExam() {
  return request({
    url: `core/statistics/exam-paper/teacherExam`,
    method: "get",
  });
}
// 考试分析学生列表
export function getStudentExam() {
  return request({
    url: `core/statistics/exam-paper/studentExam`,
    method: "get",
  });
}

// 查询具体详情接口查看平均分等数据
export function getAnalysis(id) {
  return request({
    url: `/core/exam-paper/grades-analysis/${id}`,
    method: "get",
  });
}

// 首页数据接口
export function getHomeSubject() {
  return request({
    url: `core/statistics/exam-paper/subject-statistics`,
    method: "get",
  });
}
// 一个已完成试卷的平均分
export function getHomeAverage() {
  return request({
    url: `core/statistics/exam-paper/average-score`,
    method: "get",
  });
}
// 试卷完成率统计
export function getHomeFinish() {
  return request({
    url: `core/statistics/exam-paper/finish`,
    method: "get",
  });
}
export function getHomeMessage() {
  return request({
    url: `/core/statistics/exam-paper/message`,
    method: "get",
  });
}
